<html>
<#include "../common/header.ftl">

<body>
<div id="wrapper" class="toggled">

    <#--边栏sidebar-->
    <#include "../common/nav2.ftl">

    <#--主要内容content-->
    <div id="page-content-wrapper">
        <div class="container-fluid">
            <div class="row clearfix">
                <div class="col-md-12 column">
                    <table class="table table-bordered table-condensed">
                        <thead>
                        <tr>
                            <th>进货id</th>
                            <th>商品id</th>
                            <th>商品详情</th>
                            <th>进货数量</th>
                            <th>创建时间</th>
                            <th>货源</th>
                            <th>进货单状态</th>
                            <th colspan="3">操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        <#list purchaseInfoPageInfo.list as purchase>
                            <tr>
                                <td>${purchase.purchaseId}</td>
                                <td>${purchase.productId}</td>
                                <td><a href="/sell/seller/sendProduct/queryProduct?productId=${purchase.productId}">查看</a></td>
                                <td>${purchase.productQuantity}</td>
                                <td>${purchase.getStringCreate()}</td>
                                <td>${purchase.purchaseSource}</td>
                                <td>${purchase.getFinshStatusEnum().message}</td>
                                <#if purchase.getFinshStatus()==0>
                                <td><a href="/sell/seller/sendProduct/purchase?sendId=${purchase.productQuantity}&productQuantity=${purchase.productQuantity}&purchaseId=${purchase.purchaseId}">修改</a></td>
                                </#if>
                                <#if purchase.getFinshStatus()==0>
                                <td><a href="/sell/seller/sendProduct/sureInProduct?purchaseId=${purchase.purchaseId}" type="button" class="btn btn-default btn-primary">确认进货</a><td>
                                </#if>

                            </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>

                <#--分页-->
                <div class="col-md-12 column " >
                    <ul class="pagination pull-right ">
                        <#if currentPage lte 1>
                            <li class="disabled"><a href="#">上一页</a></li>
                        <#else>
                            <li><a href="/sell/seller/sendProduct/listPurchase?page=${currentPage - 1}&size=${size}">上一页</a></li>
                        </#if>

                        <#list 1..totalpage as index>
                            <#if currentPage == index>
                                <li class="disabled"><a href="#">${index}</a></li>
                            <#else>
                                <li><a href="/sell/seller/sendProduct/listPurchase?page=${index}&size=${size}">${index}</a></li>
                            </#if>
                        </#list>

                        <#if currentPage gte totalpage>
                            <li class="disabled"><a href="#">下一页</a></li>
                        <#else>
                            <li><a href="/sell/seller/sendProduct/listPurchase?page=${currentPage + 1}&size=${size}">下一页</a></li>
                        </#if>
                    </ul>
                </div>
            </div>
        </div>
    </div>

</div>
</body>
</html>